<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fmt_rt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<%@ taglib prefix="x_rt" uri="http://java.sun.com/jstl/xml_rt"%>
<%@ taglib prefix="wr_fn" uri="http://njo.org/taglib/functions"%>
<table width="98%">
  <tr>
    <td class="left"><a name="title"><b>编辑字段集</b></a></td>
  </tr>
</table>
<c:set var="actionMessages" value="${wr_fn:amessages(pageContext, '')}"/>
<c:forEach items="${actionMessages}" var="item">
    <div class="error-content">${wr_fn:message(pageContext, item.key, item.values)}</div>
</c:forEach>
<form id="f2" name="f2" action="${pageContext.request.contextPath}/processor.savefieldset.tiles" method="post">
<table class="forum" width="98%">
<col width="100"/>
<col width="*"/>
<tbody>
  <tr>
    <th colspan="2" align="left">字段集信息</th>
  </tr>
  <tr>
    <td>物理名称:</td>
    <td>${fieldSet.field_set_physical_name}<input type="hidden" name="field_set_physical_name" value="${fieldSet.field_set_physical_name}"/></td>
  </tr>
  <tr>
    <td>逻辑名称:</td>
    <td><input type="text" name="field_set_logic_name" value="${fieldSet.field_set_logic_name}"/></td>
  </tr>
  <tr>
    <td>描述:</td>
    <td><textarea name="field_set_description">${fieldSet.field_set_description}</textarea></td>
  </tr>
</tbody>
</table>

<table class="forum" width="98%">
<col width="40"/>
<col width="80"/>
<col width="200"/>
<col width="80"/>
<col width="100"/>
<col width="60"/>
<col width="*"/>
<tbody id="_fields">
  <tr>
    <th><a title="追加" href="javascript:addField();"><img src="${pageContext.request.contextPath}/images/add.png" border="0"/></a></th>
    <th>物理名称</th>
    <th>逻辑名称</th>
    <th>类型</th>
    <th>允许Null</th>
    <th>主键</th>
    <th>外键</th>
    <th>描述</th>
  </tr>
<c:if test="${wr_fn:isEmpty(wr_fn:isEmpty(fieldSet.fields) ? paramValues.field_physical_name : fieldSet.fields)}">
<tr id="field_x" class="even">
  <td class="center" colspan="8">没有设定输入验证规则</td>
</tr>
</c:if>
<c:forEach items="${fieldSet.fields}" var="item" varStatus="itemStatus">
<script type="text/javascript">writeRow(${itemStatus.index}, '${item.field_physical_name}', '${item.allow_null}', '${item.primary_key}', '${item.foreign_key_field_set_name}', '${item.foreign_key_field_name}');</script>
</c:forEach>
</tbody>
</table>

<table width="98%">
  <tr>
    <td class="right"><input type="submit" name="save" value="保存"/> <input type="reset" name="reset" value="充填"/></td>
  </tr>
</table>
</form>
<div id="field_editor" style="background-color: #ffffff; left: 20px; top: 10px; height: 320px; width: 480px; overflow: auto; position: absolute; visibility: visible;display: none;" onmouseout="javascript:hideEditor(event, 'field_editor');">
</div>
<div id="fk_editor" style="background-color: #ffffff; left: 20px; top: 10px; height: 320px; width: 480px; overflow: auto; position: absolute; visibility: visible;display: none;" onmouseout="javascript:hideEditor(event, 'fk_editor');">
</div>
<div id="fk1_editor" style="background-color: #ffffff; left: 20px; top: 10px; height: 320px; width: 480px; overflow: auto; position: absolute; visibility: visible;display: none;" onmouseout="javascript:hideEditor(event, 'fk1_editor');">
</div>